﻿//
// Copyright (c) 2024 BPer
//
#ifndef BPERTHREAD1_H
#define BPERTHREAD1_H
#include <QThread>
#include <QVector>

#include <bperutil/buffer/BPerVideoBuffer.h>
#include <bperplayer/BPerYuvPlayWidget.h>
#include <bperplayer/BPerPlayWidget.h>
#include <bperstream/BPerSynBuffer.h>

class BPerRecordThread : public QThread
{
public:
    BPerRecordThread();
    virtual ~BPerRecordThread();

    int m_isLoop;
    void initPara();


#if BPer_OS_APPLE
    BPerYuvPlayWidget *m_video;
#else
    BPerPlayWidget *m_video;
#endif

    BPerSynBuffer* m_syn;
    bool m_isRender;

    int m_sid;
    void stopAll();
    int showType;

    void setBlackBk();

private:
    void render();
    void closeAll();

    BPerFrame m_frame;
    int m_isStart;
    int m_playWidth;
    int m_playHeight;
    uint8_t* m_playBuffer;

private:
    virtual void run();
};

#endif // BPERTHREAD_H
